package serveur;

import java.rmi.RemoteException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.UnicastRemoteObject;
import java.util.List;


@SuppressWarnings("serial")
public class ServiceClientConnecteImpl extends UnicastRemoteObject implements
		ServiceClientConnecteRemote {
	
	private TwitterDistant twitter;

	public ServiceClientConnecteImpl() throws RemoteException {
	}
	
	public ServiceClientConnecteImpl(int port) throws RemoteException {
		super(port);
	}
	
	public ServiceClientConnecteImpl(TwitterDistant twitter, int port) throws RemoteException {
		super(port);
		this.twitter = twitter;
	}

	public ServiceClientConnecteImpl(int port, RMIClientSocketFactory csf,
			RMIServerSocketFactory ssf) throws RemoteException {
		super(port, csf, ssf);
	}

	@Override
	public void tweeter(String topic, String message, ClientDistant client)
			throws RemoteException {
		twitter.tweeter(topic, message, client);
	}
	
	@Override
	public void tweeter(Tweet t, ClientDistant client) throws RemoteException {
		twitter.tweeter(t, client);
		
	}

	@Override
	public void follow(String pseudo, ClientDistant client)
			throws RemoteException {
		twitter.follow(pseudo, client);
	}

	@Override
	public void seDeconnecter(ClientDistant c) throws RemoteException {		
		twitter.seDeconnecter(c);
	}
	
	@Override
	public List<Tweet> afficherTweetUtilisateursFollowed(ClientDistant c) throws RemoteException {
		return twitter.afficherTweetUtilisateursFollowed(c);
	}
	
}
